package com.goldgov.code.json;

import java.util.ArrayList;
import java.util.List;

public class Operation {
	
	private String label;
	private String icon;
	private String handler;
	
	public Operation() {}
	
	public Operation(String label, String icon, String handler) {
		this.label = label;
		this.icon = icon;
		this.handler = handler;
	}
	public String getLabel() {
		return label;
	}
	public void setLabel(String label) {
		this.label = label;
	}
	public String getIcon() {
		return icon;
	}
	public void setIcon(String icon) {
		this.icon = icon;
	}
	public String getHandler() {
		return handler;
	}
	public void setHandler(String handler) {
		this.handler = handler;
	}
	
	public static class DropdownOperation extends Operation{
		private String type;
		private List<OptionItem> optionList = new ArrayList<>();
		
		public DropdownOperation() {}
		
		public DropdownOperation(String label, String icon, String handler) {
			super.label = label;
			super.icon = icon;
			super.handler = handler;
		}
		
		public String getType() {
			return type;
		}
		public void setType(String type) {
			this.type = type;
		}
		public List<OptionItem> getOptionList() {
			return optionList;
		}
		public void setOptionList(List<OptionItem> optionList) {
			this.optionList = optionList;
		}
		
		public void addOptionItem(String label, String value) {
			optionList.add(new OptionItem(label,value));
		}
	}
	
	public static class OptionItem{
		private String label;
		private String value;
		
		public OptionItem(String label, String value) {
			super();
			this.label = label;
			this.value = value;
		}
		public String getLabel() {
			return label;
		}
		public void setLabel(String label) {
			this.label = label;
		}
		public String getValue() {
			return value;
		}
		public void setValue(String value) {
			this.value = value;
		}
	}
}
